/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zhaoxiancheng
* @date 2023-10-17
**/
@Entity
@Data
@Table(name="user_family_members")
public class UserFamilyMembers implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "member_id")
    @ApiModelProperty(value = "主键ID")
    private Long memberId;

    @Column(name = "open_id")
    @ApiModelProperty(value = "openId")
    private String openId;

    @Column(name = "member_role")
    @ApiModelProperty(value = "成员角色")
    private String memberRole;

    @Column(name = "user_name")
    @ApiModelProperty(value = "成员名称")
    private String userName;

    @Column(name = "member_age")
    @ApiModelProperty(value = "成员年龄")
    private String memberAge;

    @Column(name = "member_sex")
    @ApiModelProperty(value = "成员性别")
    private Integer memberSex;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "createby")
    @ApiModelProperty(value = "创建人")
    private String createby;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "updateby")
    @ApiModelProperty(value = "更新人")
    private String updateby;

    public void copy(UserFamilyMembers source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}